package it.slothy.noveleditor.classes.objects;

import it.slothy.noveleditor.classes.elements.VNObject;
import it.slothy.noveleditor.classes.variables.ActStat;
import it.slothy.noveleditor.enumaration.Gender;
import it.slothy.noveleditor.enumaration.VNEnumObject;

import java.io.File;
import java.util.HashMap;

public abstract class Actor extends VNObject{

	private Gender gender;
	private File charaImage;
	private int age;
	private HashMap<String, File> actorStates;
	private HashMap<String, ActStat> actorStatistics;
	
	public Actor(String n, Gender g, File c, int a){
		super(VNEnumObject.OBJ_ACTOR, n);
		this.setGender(g);
		this.setCharaImage(c);
		this.setAge(a);
		this.actorStates = new HashMap<String, File>();
		this.actorStatistics = new HashMap<String, ActStat>();
	}

	public Actor(String n, Gender g, String c, int a){
		this(n, g, new File(c), a);
	}
	
	//State
	public void addState(String k, File f){
		this.actorStates.put(k, f);
	}
	
	public File getState(String s) {
		return this.actorStates.get(s);
	}
	
	public void removeState(String s) {
		this.actorStates.remove(s);
	}
	
	//Statistic
	public void addStatistic(ActStat s){
		this.actorStatistics.put(s.getStat().getName(), s);
	}
	
	//String s = nome della statistica
	public ActStat getStatistic(String s) {
		return this.actorStatistics.get(s);
	}
	
	public void removeStatistic(String s) {
		this.actorStatistics.remove(s);
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public File getCharaImage() {
		return charaImage;
	}

	public void setCharaImage(File charaImage) {
		this.charaImage = charaImage;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}
}
